<?php
include("../inc/global.inc");
if($_POST[act]=="sandi"){
   if($_SESSION['chkCode']!=$_POST['c_code']){
		 echo "<script>alert('验证码错误');location='javascript:history.back()';</script>";
    }
	else if($_POST[s_title]=="" || $_POST[s_con]=="" || $_POST[s_people]=="")
	{
		echo "<script>alert('信息输入不完整');location='javascript:history.back()';</script>";
	}
	else if(trim($_POST[s_tel])=="" && trim($_POST[s_mobile])=="")
	{
		echo "<script>alert('固定电话或者手机必须填写一项');location='javascript:history.back()';</script>";
	}
	else{
			$q="insert into caigou (c_title,c_people,c_tel,c_mobile,c_mail,c_info,c_qq,addtime) values ('$_POST[s_title]','$_POST[s_people]','$_POST[s_tel]','$_POST[s_mobile]','$_POST[s_mail]','$_POST[s_con]','$_POST[s_qq]','".date("Y-m-d H:i:s")."')";
	         @mysql_query($q);
			 //echo $q;
	  echo "<script>alert('提交成功');location='/index.php';</script>";
	 //print_r($_POST);
    }
}
?>